<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>Jason-3SSHA数据处理与可视化——Python代码实现 | 洛沐の人间客栈</title><meta name="keywords" content="Python卫星数据处理"><meta name="author" content="洛沐,guojiaxiang0820@gmail.com"><meta name="copyright" content="洛沐"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="本文利用Python对Jason-3 SSHA数据进行逐日数据绘图，并绘制SSHA等值线等处理过程。">
<meta property="og:type" content="article">
<meta property="og:title" content="Jason-3SSHA数据处理与可视化——Python代码实现">
<meta property="og:url" content="https://www.guojxblog.cn/archives/59a3b95f.html">
<meta property="og:site_name" content="洛沐の人间客栈">
<meta property="og:description" content="本文利用Python对Jason-3 SSHA数据进行逐日数据绘图，并绘制SSHA等值线等处理过程。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/lulu.jpg">
<meta property="article:published_time" content="2023-03-12T15:02:12.000Z">
<meta property="article:modified_time" content="2023-03-20T15:00:56.629Z">
<meta property="article:author" content="洛沐">
<meta property="article:tag" content="Python卫星数据处理">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/lulu.jpg"><link rel="shortcut icon" href="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/RS_icon.jpg"><link rel="canonical" href="https://www.guojxblog.cn/archives/59a3b95f"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta name="baidu-site-verification" content="code-zGPrfnFp7y"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: {"limitDay":180,"position":"top","messagePrev":"此文中创建于","messageNext":"天之前，请以最新文章为准！"},
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":500},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: true
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":50,"languages":{"author":"作者: 洛沐","link":"链接: ","source":"来源: 洛沐の人间客栈","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'mediumZoom',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"bottom-left"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isAnchor: true
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Jason-3SSHA数据处理与可视化——Python代码实现',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-03-20 23:00:56'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          const now = new Date()
          const hour = now.getHours()
          const isNight = hour <= 6 || hour >= 18
          if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
          else if (t === 'light') activateLightMode()
          else activateDarkMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/css/style.css"><link rel="stylesheet" href="/css/iconfont.css"><link rel="stylesheet" href="/css/font-awesome.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sviptzk/StaticFile_HEXO@latest/butterfly/css/macblack.css"><script src="/live2d-widget/autoload.js"></script><meta name="generator" content="Hexo 6.1.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/touxiang.jpeg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">29</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">18</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group hide" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fa fa-graduation-cap"></i><span> 文章</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fa fa-folder-open"></i><span> 归档</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fa fa-archive"></i><span> 分类</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> 标签</span></a></li></ul></div><div class="menus_item"><a class="site-page group hide" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fa-solid fa-heart-pulse"></i><span> 生活</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/books/"><i class="fa-fw fas fa-book-reader"></i><span> 读书</span></a></li><li><a class="site-page child" href="/photos/"><i class="fa-fw fa fa-camera-retro"></i><span> 相册</span></a></li><li><a class="site-page child" href="/music/"><i class="fa-fw fa fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 影视</span></a></li></ul></div><div class="menus_item"><a class="site-page group hide" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fa-solid fa-keyboard"></i><span> 动态</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/comment/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言</span></a></li><li><a class="site-page child" href="/notes/"><i class="fa-fw fas fa-feather-alt"></i><span> 随笔</span></a></li><li><a class="site-page child" href="/ideas/"><i class="fa-fw fa-solid fa-lightbulb"></i><span> 妙想</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fa fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/lulu.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">洛沐の人间客栈</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group hide" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fa fa-graduation-cap"></i><span> 文章</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fa fa-folder-open"></i><span> 归档</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fa fa-archive"></i><span> 分类</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> 标签</span></a></li></ul></div><div class="menus_item"><a class="site-page group hide" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fa-solid fa-heart-pulse"></i><span> 生活</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/books/"><i class="fa-fw fas fa-book-reader"></i><span> 读书</span></a></li><li><a class="site-page child" href="/photos/"><i class="fa-fw fa fa-camera-retro"></i><span> 相册</span></a></li><li><a class="site-page child" href="/music/"><i class="fa-fw fa fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 影视</span></a></li></ul></div><div class="menus_item"><a class="site-page group hide" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw fa-solid fa-keyboard"></i><span> 动态</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/comment/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言</span></a></li><li><a class="site-page child" href="/notes/"><i class="fa-fw fas fa-feather-alt"></i><span> 随笔</span></a></li><li><a class="site-page child" href="/ideas/"><i class="fa-fw fa-solid fa-lightbulb"></i><span> 妙想</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fa fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Jason-3SSHA数据处理与可视化——Python代码实现</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-03-12T15:02:12.000Z" title="发表于 2023-03-12 23:02:12">2023-03-12</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-03-20T15:00:56.629Z" title="更新于 2023-03-20 23:00:56">2023-03-20</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E7%A8%8B%E5%BA%8F%E4%BB%A3%E7%A0%81/">程序代码</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">3.1k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>16分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Jason-3SSHA数据处理与可视化——Python代码实现"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="Jason-3数据介绍"><a href="#Jason-3数据介绍" class="headerlink" title="Jason-3数据介绍"></a>Jason-3数据介绍</h1><p>OSTM&#x2F;Jason-3是jason-2的后续任务。这个卫星的名字是以希腊神话中的一位英雄的名字命名的，该英雄出自于阿尔戈英雄，指的是希腊传说中同伊阿宋（jason）一道乘快船“阿尔戈号”去科尔基斯（Colchis）的阿瑞斯圣林取金羊毛的50位英雄，Jason是首领。OSTM&#x2F;Jason-3接管并延续Jason-2的任务。为的是促进测高任务的全面发展，能够满足运行程序对数据的时效性和可靠性的需求。</p>
<p>Jason-3卫星高度计于2016年1月17日成功发射，2016年2月12日进入预定轨道，与Jason-2高度计同轨进入编队飞行阶段，并落后Jason-2高度计约1分20秒，两者相距约560 km。2016年9月1日，Jason-2高度计变换轨道，编队飞行阶段结束，两高度计进入平行轨道，以增加卫星高度计对地观测的空间覆盖。</p>
<p>本研究主要开展了Jason-3高度计的数据质量的评估与检验，包括Jason-3高度计数据可用性和有效性的验证，以及Jason-3高度计和校正辐射计各参数的数据质量监测。重点开展了Jason-2与Jason-3高度计各项参数的综合比较，利用Jason-2与Jason-3高度计编队飞行阶段的数据精确评估了两高度计参数的一致性，并从全球数据角度分析了Jason-3高度计获取各参数的能力以及稳定性；通过与Jason-2互交叉点比较分析评估Jason-3高度计海面高度数据质量情况，验证Jason-3高度计数据精度。</p>
<p>结果表明，Jason-3高度计的数据质量满足高度计测高的要求，具有与Jason-1、Jason-2、T&#x2F;P等高度计相同或更高的测高精度以监测全球海平面变化，此外，Jason-3有效波高参数数据质量明显优于Jason-2高度计。</p>
<ul>
<li>表1 Jason系列数据介绍：</li>
</ul>
<table>
<thead>
<tr>
<th align="center">辅助数据</th>
<th align="center">影响参数</th>
<th align="center">OGDR</th>
<th align="center">IGDR</th>
<th align="center">GDR</th>
</tr>
</thead>
<tbody><tr>
<td align="center">轨道</td>
<td align="center">卫星高度，多普勒校正…</td>
<td align="center">ORIS导航器</td>
<td align="center">初步的（MOE用DORIS数据）</td>
<td align="center">精确的（POE使用DORIS&#x2F;激光&#x2F;GPS数据）</td>
</tr>
<tr>
<td align="center">气压计字段</td>
<td align="center">干&#x2F;湿对流层改正，U&#x2F;V风矢量，地面气压，逆气压改正</td>
<td align="center">预测的</td>
<td align="center">恢复的</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">极点位置</td>
<td align="center">极潮高度</td>
<td align="center">预测的</td>
<td align="center">恢复的</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">Mog2D</td>
<td align="center">HF ocean dealiasing correction</td>
<td align="center">无法使用</td>
<td align="center">初步的</td>
<td align="center">精确的</td>
</tr>
<tr>
<td align="center">GIM</td>
<td align="center">电离层校正</td>
<td align="center">无法使用</td>
<td align="center">可用</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">辐射计天线温度的多项式系数</td>
<td align="center">湿对流层改正，Sigma0降雨衰减，…</td>
<td align="center">初步的</td>
<td align="center">精确的（辐射计定标）</td>
<td align="center"></td>
</tr>
</tbody></table>
<p>本实验采用的是OGDR中的Cycle210，2021&#x2F;10&#x2F;20-10&#x2F;30数据，其数据储存与Jason-2有所差异，经纬度存在了二级目录的variables数据集中，而SSHA数据则存在了三级目录中的variables数据集中，读取时需注意。</p>
<h1 id="Python代码与注释详解"><a href="#Python代码与注释详解" class="headerlink" title="Python代码与注释详解"></a>Python代码与注释详解</h1><h2 id="逐日数据画在地图（每日一张，标注经纬度、数值colorbar、日期title等），保存图片代码"><a href="#逐日数据画在地图（每日一张，标注经纬度、数值colorbar、日期title等），保存图片代码" class="headerlink" title="逐日数据画在地图（每日一张，标注经纬度、数值colorbar、日期title等），保存图片代码"></a>逐日数据画在地图（每日一张，标注经纬度、数值colorbar、日期title等），保存图片代码</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> mpl_toolkits.basemap <span class="keyword">import</span> Basemap</span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> netCDF4 <span class="keyword">as</span> nc</span><br><span class="line"><span class="keyword">from</span> matplotlib <span class="keyword">import</span> cm</span><br><span class="line"><span class="keyword">from</span> matplotlib.colors <span class="keyword">import</span> LinearSegmentedColormap <span class="keyword">as</span> lsc</span><br><span class="line"><span class="keyword">import</span> os</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># np.set_printoptions(threshold=np.inf)</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">set_colormap</span>():</span><br><span class="line">    colormap = np.zeros((<span class="number">256</span>, <span class="number">3</span>), np.float64)</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">0</span>, <span class="number">256</span>, <span class="number">1</span>):</span><br><span class="line">        colormap[i, <span class="number">0</span>] = cm.jet(i)[<span class="number">0</span>] * <span class="number">255.0</span></span><br><span class="line">        colormap[i, <span class="number">1</span>] = cm.jet(i)[<span class="number">0</span>] * <span class="number">255.0</span></span><br><span class="line">        colormap[i, <span class="number">2</span>] = cm.jet(i)[<span class="number">0</span>] * <span class="number">255.0</span></span><br><span class="line">        <span class="comment"># colormap[0, :] = [255., 255., 255.]</span></span><br><span class="line">    <span class="keyword">return</span> colormap</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">find_max</span>(<span class="params">data_matrix</span>):</span><br><span class="line">    new_data = []</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(data_matrix)):</span><br><span class="line">        new_data.append(<span class="built_in">max</span>(data_matrix[i]))</span><br><span class="line">    <span class="comment"># print(&quot;数组最大值为：&quot;, max(new_data))</span></span><br><span class="line">    <span class="keyword">return</span> <span class="built_in">max</span>(new_data)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">find_min</span>(<span class="params">data_matrix</span>):</span><br><span class="line">    new_data = []</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(data_matrix)):</span><br><span class="line">        new_data.append(<span class="built_in">min</span>(data_matrix[i]))</span><br><span class="line">    <span class="comment"># print(&#x27;数组最小值为：&#x27;, min(new_data))</span></span><br><span class="line">    <span class="keyword">return</span> <span class="built_in">min</span>(new_data)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">variables_extact</span>(<span class="params">file</span>):</span><br><span class="line">    lon_list = []</span><br><span class="line">    lat_list = []</span><br><span class="line">    ssha_list = []</span><br><span class="line">    ssha_w_list = []</span><br><span class="line">    <span class="keyword">for</span> f <span class="keyword">in</span> file:</span><br><span class="line">        <span class="string">&#x27;&#x27;&#x27;第一重数据集--*.nc Dataset&#x27;&#x27;&#x27;</span></span><br><span class="line">        dataset_nc = nc.Dataset(f)</span><br><span class="line">        <span class="string">&#x27;&#x27;&#x27;第二重数据集--groups Dataset&#x27;&#x27;&#x27;</span></span><br><span class="line">        data_01 = dataset_nc.groups[<span class="string">&#x27;data_01&#x27;</span>]</span><br><span class="line">        lon = (data_01.variables[<span class="string">&#x27;longitude&#x27;</span>][:])</span><br><span class="line">        lat = (data_01.variables[<span class="string">&#x27;latitude&#x27;</span>][:])</span><br><span class="line">        <span class="string">&#x27;&#x27;&#x27;第三重数据集--ku Dataset&#x27;&#x27;&#x27;</span></span><br><span class="line">        ku = data_01.groups[<span class="string">&#x27;ku&#x27;</span>]</span><br><span class="line">        ssha = (ku.variables[<span class="string">&#x27;ssha&#x27;</span>][:])</span><br><span class="line">        data_lon = np.array(lon)</span><br><span class="line">        data_lat = np.array(lat)</span><br><span class="line">        data_ssha_all = np.array(ssha)</span><br><span class="line">        data_ssha = np.where(data_ssha_all != <span class="number">32767</span>, data_ssha_all * <span class="number">100</span>, <span class="number">0</span>)</span><br><span class="line">        min_lon = find_min([data_lon])</span><br><span class="line">        max_lon = find_max([data_lon])</span><br><span class="line">        min_lat = find_min([data_lat])</span><br><span class="line">        max_lat = find_max([data_lat])</span><br><span class="line">        min_ssha = find_min([data_ssha])</span><br><span class="line">        max_ssha = find_max([data_ssha])</span><br><span class="line">        <span class="comment"># print(min_lon, max_lon, min_lat, max_lat, min_ssha, max_ssha)</span></span><br><span class="line">        <span class="comment"># data_ssha[np.where(data_ssha != 0)] = 100 * (data_ssha[np.where(data_ssha != 0)] - min_ssha) / (</span></span><br><span class="line">        <span class="comment">#         max_ssha - min_ssha)</span></span><br><span class="line">        data_ssha_w = data_ssha * <span class="number">100</span></span><br><span class="line">        <span class="comment"># print(len(data_lon), len(data_lat), len(time), len(data_ssha))</span></span><br><span class="line">        <span class="comment"># print(data_lon, data_lat, data_time, data_ssha)</span></span><br><span class="line">        lon_list.append(data_lon)</span><br><span class="line">        lat_list.append(data_lat)</span><br><span class="line">        ssha_list.append(data_ssha)</span><br><span class="line">        ssha_w_list.append(data_ssha_w)</span><br><span class="line">    <span class="built_in">print</span>(lon_list)</span><br><span class="line">    <span class="built_in">print</span>(lat_list)</span><br><span class="line">    <span class="built_in">print</span>(ssha_list)</span><br><span class="line">    <span class="built_in">print</span>(ssha_w_list)</span><br><span class="line">    <span class="keyword">return</span> lon_list, lat_list, ssha_list, ssha_w_list</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">show_data</span>(<span class="params">file</span>):</span><br><span class="line">    lon_list, lat_list, ssha_list, ssha_w_list = variables_extact(file)</span><br><span class="line">    <span class="built_in">map</span> = Basemap(projection=<span class="string">&#x27;cyl&#x27;</span>, llcrnrlat=-<span class="number">90.</span>, urcrnrlat=<span class="number">90.</span>, llcrnrlon=<span class="number">0.</span>, urcrnrlon=<span class="number">361.</span>, resolution=<span class="string">&#x27;l&#x27;</span>,</span><br><span class="line">                  lat_0=<span class="number">0</span>, lon_0=<span class="number">180</span>)</span><br><span class="line">    <span class="built_in">map</span>.drawmapboundary(fill_color=<span class="string">&#x27;aqua&#x27;</span>)</span><br><span class="line">    <span class="built_in">map</span>.fillcontinents(color=<span class="string">&#x27;gray&#x27;</span>, lake_color=<span class="string">&#x27;aqua&#x27;</span>)</span><br><span class="line">    <span class="built_in">map</span>.drawstates()</span><br><span class="line">    <span class="built_in">map</span>.drawcoastlines()</span><br><span class="line">    <span class="comment"># lons, lats = map.makegrid(1, 6598)</span></span><br><span class="line">    <span class="comment"># lats = lats[::-1]</span></span><br><span class="line">    <span class="comment"># x, y = map(lons, lats)</span></span><br><span class="line">    <span class="built_in">map</span>.drawparallels(np.arange(-<span class="number">90.</span>, <span class="number">91.</span>, <span class="number">30.</span>), labels=[<span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>], fontsize=<span class="number">12</span>)</span><br><span class="line">    <span class="built_in">map</span>.drawmeridians(np.arange(-<span class="number">180.</span>, <span class="number">181.</span>, <span class="number">60.</span>), labels=[<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>], fontsize=<span class="number">12</span>)</span><br><span class="line"></span><br><span class="line">    <span class="comment"># x, y = np.meshgrid(data_lon, data_lat)</span></span><br><span class="line">    <span class="comment"># curve = map.contour(x, y, data_ssha)</span></span><br><span class="line">    cmap_color = plt.cm.get_cmap(<span class="string">&quot;Accent_r&quot;</span>)</span><br><span class="line">    <span class="comment"># shade = map.contourf(x, y, data_ssha, cmap=cmap_color)</span></span><br><span class="line"></span><br><span class="line">    <span class="comment"># colormap = set_colormap()</span></span><br><span class="line">    <span class="comment"># color_table = lsc.from_list(&#x27;ssha map&#x27;, colormap / 255.0)</span></span><br><span class="line">    <span class="comment"># print(len(lat_list))</span></span><br><span class="line">    <span class="comment"># print(lon_list, lat_list, ssha_list, ssha_w_list)</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(ssha_list)):</span><br><span class="line">        line_ssha = <span class="built_in">map</span>.scatter(lon_list[i], lat_list[i], c=ssha_w_list[i], s=<span class="number">1</span>, vmin=-<span class="number">500</span>, vmax=<span class="number">500</span>)</span><br><span class="line">    cbar = <span class="built_in">map</span>.colorbar(line_ssha)</span><br><span class="line">    cbar.ax.tick_params(labelsize=<span class="number">12</span>)</span><br><span class="line">    <span class="comment"># for j in prefix_list:</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">&#x27;__main__&#x27;</span>:</span><br><span class="line">    postfix = <span class="string">&#x27;.nc&#x27;</span></span><br><span class="line">    prefix_list = [<span class="string">&#x27;20211020&#x27;</span>, <span class="string">&#x27;20211021&#x27;</span>, <span class="string">&#x27;20211022&#x27;</span>, <span class="string">&#x27;20211023&#x27;</span>, <span class="string">&#x27;20211024&#x27;</span>, <span class="string">&#x27;20211025&#x27;</span>, <span class="string">&#x27;20211026&#x27;</span>, <span class="string">&#x27;20211027&#x27;</span>,</span><br><span class="line">                   <span class="string">&#x27;20211028&#x27;</span>, <span class="string">&#x27;20211029&#x27;</span>, <span class="string">&#x27;20211030&#x27;</span>]</span><br><span class="line">    <span class="built_in">print</span>(prefix_list)</span><br><span class="line">    input_path = <span class="string">&#x27;/Users/leo/Desktop/MarineTechTest5/Data_Jason3/&#x27;</span></span><br><span class="line">    output_path = <span class="string">&#x27;/Users/leo/Desktop/MarineTechTest5/Results/&#x27;</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> <span class="keyword">not</span> os.path.exists(output_path):</span><br><span class="line">        os.mkdir(output_path)</span><br><span class="line">    file_list = os.listdir(input_path)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">for</span> k <span class="keyword">in</span> prefix_list:</span><br><span class="line">        day_list = []</span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> file_list:</span><br><span class="line">            <span class="keyword">if</span> i.endswith(postfix) <span class="keyword">and</span> i[<span class="number">20</span>:].startswith(k):</span><br><span class="line">                file = input_path + i</span><br><span class="line">                <span class="comment"># print(file)</span></span><br><span class="line">                day_list.append(file)</span><br><span class="line">        <span class="built_in">print</span>(day_list)</span><br><span class="line"></span><br><span class="line">        lon, lat, ssha, ssha_w = variables_extact(day_list)</span><br><span class="line">        <span class="comment"># ssha_w_list.append(ssha_w)</span></span><br><span class="line">        <span class="comment"># print(ssha_w_list)</span></span><br><span class="line">        show_data(day_list)</span><br><span class="line">        plt.title(k + <span class="string">&#x27; Spatial Distribution Map of Jason-3 SSHA(cm)&#x27;</span>, fontsize=<span class="number">12</span>)</span><br><span class="line">        plt.savefig(output_path + k + <span class="string">&#x27;.png&#x27;</span>, dpi=<span class="number">600</span>)</span><br><span class="line">        plt.show()</span><br></pre></td></tr></table></figure>
<h2 id="Cycle210，2021-x2F-10-x2F-20-10-x2F-30数据画在一张地图上（一共一张，标注经纬度、数值colorbar、日期title等）-），保存图片代码"><a href="#Cycle210，2021-x2F-10-x2F-20-10-x2F-30数据画在一张地图上（一共一张，标注经纬度、数值colorbar、日期title等）-），保存图片代码" class="headerlink" title="Cycle210，2021&#x2F;10&#x2F;20-10&#x2F;30数据画在一张地图上（一共一张，标注经纬度、数值colorbar、日期title等） ），保存图片代码"></a>Cycle210，2021&#x2F;10&#x2F;20-10&#x2F;30数据画在一张地图上（一共一张，标注经纬度、数值colorbar、日期title等） ），保存图片代码</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> mpl_toolkits.basemap <span class="keyword">import</span> Basemap</span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> netCDF4 <span class="keyword">as</span> nc</span><br><span class="line"><span class="keyword">from</span> matplotlib <span class="keyword">import</span> cm</span><br><span class="line"><span class="keyword">from</span> matplotlib.colors <span class="keyword">import</span> LinearSegmentedColormap <span class="keyword">as</span> lsc</span><br><span class="line"><span class="keyword">import</span> os</span><br><span class="line"><span class="keyword">from</span> mpl_toolkits.mplot3d <span class="keyword">import</span> Axes3D</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># np.set_printoptions(threshold=np.inf)</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">set_colormap</span>():</span><br><span class="line">    colormap = np.zeros((<span class="number">256</span>, <span class="number">3</span>), np.float64)</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">0</span>, <span class="number">256</span>, <span class="number">1</span>):</span><br><span class="line">        colormap[i, <span class="number">0</span>] = cm.jet(i)[<span class="number">0</span>] * <span class="number">255.0</span></span><br><span class="line">        colormap[i, <span class="number">1</span>] = cm.jet(i)[<span class="number">0</span>] * <span class="number">255.0</span></span><br><span class="line">        colormap[i, <span class="number">2</span>] = cm.jet(i)[<span class="number">0</span>] * <span class="number">255.0</span></span><br><span class="line">        <span class="comment"># colormap[0, :] = [255., 255., 255.]</span></span><br><span class="line">    <span class="keyword">return</span> colormap</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">find_max</span>(<span class="params">data_matrix</span>):</span><br><span class="line">    new_data = []</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(data_matrix)):</span><br><span class="line">        new_data.append(<span class="built_in">max</span>(data_matrix[i]))</span><br><span class="line">    <span class="comment"># print(&quot;数组最大值为：&quot;, max(new_data))</span></span><br><span class="line">    <span class="keyword">return</span> <span class="built_in">max</span>(new_data)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">find_min</span>(<span class="params">data_matrix</span>):</span><br><span class="line">    new_data = []</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(data_matrix)):</span><br><span class="line">        new_data.append(<span class="built_in">min</span>(data_matrix[i]))</span><br><span class="line">    <span class="comment"># print(&#x27;数组最小值为：&#x27;, min(new_data))</span></span><br><span class="line">    <span class="keyword">return</span> <span class="built_in">min</span>(new_data)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">variables_extact</span>(<span class="params">file</span>):</span><br><span class="line">    lon_list = []</span><br><span class="line">    lat_list = []</span><br><span class="line">    ssha_list = []</span><br><span class="line">    ssha_w_list = []</span><br><span class="line">    <span class="keyword">for</span> f <span class="keyword">in</span> file:</span><br><span class="line">        <span class="string">&#x27;&#x27;&#x27;第一重数据集--*.nc Dataset&#x27;&#x27;&#x27;</span></span><br><span class="line">        dataset_nc = nc.Dataset(f)</span><br><span class="line">        <span class="string">&#x27;&#x27;&#x27;第二重数据集--groups Dataset&#x27;&#x27;&#x27;</span></span><br><span class="line">        data_01 = dataset_nc.groups[<span class="string">&#x27;data_01&#x27;</span>]</span><br><span class="line">        lon = (data_01.variables[<span class="string">&#x27;longitude&#x27;</span>][:])</span><br><span class="line">        lat = (data_01.variables[<span class="string">&#x27;latitude&#x27;</span>][:])</span><br><span class="line">        <span class="string">&#x27;&#x27;&#x27;第三重数据集--ku Dataset&#x27;&#x27;&#x27;</span></span><br><span class="line">        ku = data_01.groups[<span class="string">&#x27;ku&#x27;</span>]</span><br><span class="line">        ssha = (ku.variables[<span class="string">&#x27;ssha&#x27;</span>][:])</span><br><span class="line">        data_lon = np.array(lon)</span><br><span class="line">        data_lat = np.array(lat)</span><br><span class="line">        data_ssha_all = np.array(ssha)</span><br><span class="line">        data_ssha = np.where(data_ssha_all != <span class="number">32767</span>, data_ssha_all * <span class="number">100</span>, <span class="number">0</span>)</span><br><span class="line">        min_lon = find_min([data_lon])</span><br><span class="line">        max_lon = find_max([data_lon])</span><br><span class="line">        min_lat = find_min([data_lat])</span><br><span class="line">        max_lat = find_max([data_lat])</span><br><span class="line">        min_ssha = find_min([data_ssha])</span><br><span class="line">        max_ssha = find_max([data_ssha])</span><br><span class="line">        <span class="comment"># print(min_lon, max_lon, min_lat, max_lat, min_ssha, max_ssha)</span></span><br><span class="line">        <span class="comment"># data_ssha[np.where(data_ssha != 0)] = 100 * (data_ssha[np.where(data_ssha != 0)] - min_ssha) / (</span></span><br><span class="line">        <span class="comment">#         max_ssha - min_ssha)</span></span><br><span class="line">        data_ssha_w = data_ssha * <span class="number">100</span></span><br><span class="line">        <span class="comment"># print(len(data_lon), len(data_lat), len(time), len(data_ssha))</span></span><br><span class="line">        <span class="comment"># print(data_lon, data_lat, data_time, data_ssha)</span></span><br><span class="line">        lon_list.append(data_lon)</span><br><span class="line">        lat_list.append(data_lat)</span><br><span class="line">        ssha_list.append(data_ssha)</span><br><span class="line">        ssha_w_list.append(data_ssha_w)</span><br><span class="line">    <span class="comment"># print(lon_list)</span></span><br><span class="line">    <span class="comment"># print(lat_list)</span></span><br><span class="line">    <span class="comment"># print(ssha_list)</span></span><br><span class="line">    <span class="comment"># print(ssha_w_list)</span></span><br><span class="line">    <span class="keyword">return</span> lon_list, lat_list, ssha_list, ssha_w_list</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">show_data</span>(<span class="params">file</span>):</span><br><span class="line">    lon_list, lat_list, ssha_list, ssha_w_list = variables_extact(file)</span><br><span class="line">    <span class="built_in">map</span> = Basemap(projection=<span class="string">&#x27;cyl&#x27;</span>, llcrnrlat=-<span class="number">90.</span>, urcrnrlat=<span class="number">90.</span>, llcrnrlon=<span class="number">0.</span>, urcrnrlon=<span class="number">361.</span>, resolution=<span class="string">&#x27;l&#x27;</span>,</span><br><span class="line">                  lat_0=<span class="number">0</span>, lon_0=<span class="number">180</span>)</span><br><span class="line">    <span class="built_in">map</span>.drawmapboundary(fill_color=<span class="string">&#x27;aqua&#x27;</span>)</span><br><span class="line">    <span class="built_in">map</span>.fillcontinents(color=<span class="string">&#x27;gray&#x27;</span>, lake_color=<span class="string">&#x27;aqua&#x27;</span>)</span><br><span class="line">    <span class="built_in">map</span>.drawstates()</span><br><span class="line">    <span class="built_in">map</span>.drawcoastlines()</span><br><span class="line">    <span class="comment"># lons, lats = map.makegrid(1, 6598)</span></span><br><span class="line">    <span class="comment"># lats = lats[::-1]</span></span><br><span class="line">    <span class="comment"># x, y = map(lons, lats)</span></span><br><span class="line">    <span class="built_in">map</span>.drawparallels(np.arange(-<span class="number">90.</span>, <span class="number">91.</span>, <span class="number">30.</span>), labels=[<span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>], fontsize=<span class="number">12</span>)</span><br><span class="line">    <span class="built_in">map</span>.drawmeridians(np.arange(-<span class="number">180.</span>, <span class="number">181.</span>, <span class="number">60.</span>), labels=[<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>], fontsize=<span class="number">12</span>)</span><br><span class="line">    <span class="comment"># ax = plt.axes(projection=&#x27;3d&#x27;)</span></span><br><span class="line">    <span class="comment"># x, y = np.meshgrid(data_lon, data_lat)</span></span><br><span class="line">    <span class="comment"># curve = map.contour(x, y, data_ssha)</span></span><br><span class="line">    cmap_color = plt.cm.get_cmap(<span class="string">&quot;Accent_r&quot;</span>)</span><br><span class="line">    <span class="comment"># shade = map.contourf(x, y, data_ssha, cmap=cmap_color)</span></span><br><span class="line"></span><br><span class="line">    <span class="comment"># colormap = set_colormap()</span></span><br><span class="line">    <span class="comment"># color_table = lsc.from_list(&#x27;ssha map&#x27;, colormap / 255.0)</span></span><br><span class="line">    <span class="comment"># print(len(lat_list))</span></span><br><span class="line">    <span class="comment"># print(lon_list, lat_list, ssha_list, ssha_w_list)</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(ssha_list)):</span><br><span class="line">        <span class="comment"># Z = np.expand_dims(ssha_w_list[i], axis=1)</span></span><br><span class="line">        line_ssha = <span class="built_in">map</span>.scatter(lon_list[i], lat_list[i], c=ssha_w_list[i], s=<span class="number">1</span>, vmin=-<span class="number">500</span>, vmax=<span class="number">500</span>)</span><br><span class="line">        <span class="comment"># surface_ssha = ax.plot_surface(lon_list, lat_list, Z, cmap=&#x27;rainbow&#x27;)</span></span><br><span class="line">    cbar = <span class="built_in">map</span>.colorbar(line_ssha)</span><br><span class="line">    cbar.ax.tick_params(labelsize=<span class="number">12</span>)</span><br><span class="line">    <span class="comment"># for j in prefix_list:</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">&#x27;__main__&#x27;</span>:</span><br><span class="line">    postfix = <span class="string">&#x27;.nc&#x27;</span></span><br><span class="line">    <span class="comment"># prefix_list = [&#x27;20211020&#x27;, &#x27;20211021&#x27;, &#x27;20211022&#x27;, &#x27;20211023&#x27;, &#x27;20211024&#x27;, &#x27;20211025&#x27;, &#x27;20211026&#x27;, &#x27;20211027&#x27;,</span></span><br><span class="line">    <span class="comment">#                &#x27;20211028&#x27;, &#x27;20211029&#x27;, &#x27;20211030&#x27;]</span></span><br><span class="line">    <span class="comment"># print(prefix_list)</span></span><br><span class="line">    input_path = <span class="string">&#x27;/Users/leo/Desktop/MarineTechTest5/Data_Jason3/&#x27;</span></span><br><span class="line">    output_path = <span class="string">&#x27;/Users/leo/Desktop/MarineTechTest5/Results/&#x27;</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> <span class="keyword">not</span> os.path.exists(output_path):</span><br><span class="line">        os.mkdir(output_path)</span><br><span class="line">    file_list = os.listdir(input_path)</span><br><span class="line">    day_list = []</span><br><span class="line">    <span class="comment"># for k in prefix_list:</span></span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> file_list:</span><br><span class="line">        <span class="keyword">if</span> i.endswith(postfix):</span><br><span class="line">            file = input_path + i</span><br><span class="line">            <span class="comment"># print(file)</span></span><br><span class="line">            day_list.append(file)</span><br><span class="line"></span><br><span class="line">    <span class="built_in">print</span>(day_list)</span><br><span class="line"></span><br><span class="line">    lon, lat, ssha, ssha_w = variables_extact(day_list)</span><br><span class="line">    <span class="comment"># ssha_w_list.append(ssha_w)</span></span><br><span class="line">    <span class="comment"># print(ssha_w_list)</span></span><br><span class="line">    show_data(day_list)</span><br><span class="line">    plt.title(<span class="string">&#x27;20211020-30 Spatial Distribution Map of Jason-3 SSHA(cm)&#x27;</span>, fontsize=<span class="number">12</span>)</span><br><span class="line">    plt.savefig(output_path + <span class="string">&#x27;20211020-30.png&#x27;</span>, dpi=<span class="number">600</span>)</span><br><span class="line">    plt.show()</span><br></pre></td></tr></table></figure>
<h2 id="2021-x2F-10-x2F-20-10-x2F-30数据画等值线图，保存图片代码"><a href="#2021-x2F-10-x2F-20-10-x2F-30数据画等值线图，保存图片代码" class="headerlink" title="2021&#x2F;10&#x2F;20-10&#x2F;30数据画等值线图，保存图片代码"></a>2021&#x2F;10&#x2F;20-10&#x2F;30数据画等值线图，保存图片代码</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> netCDF4 <span class="keyword">as</span> nc</span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"><span class="keyword">from</span> mpl_toolkits.mplot3d <span class="keyword">import</span> Axes3D</span><br><span class="line"><span class="keyword">import</span> os, math</span><br><span class="line"><span class="keyword">import</span> show_ssha_map <span class="keyword">as</span> ssm</span><br><span class="line"><span class="keyword">from</span> mpl_toolkits.basemap <span class="keyword">import</span> Basemap</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># from mpl_toolkits.basemap import Basemap</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># map = Basemap()</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># np.set_printoptions(threshold=np.inf)</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">find_max</span>(<span class="params">data_matrix</span>):</span><br><span class="line">    new_data = []</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(data_matrix)):</span><br><span class="line">        new_data.append(<span class="built_in">max</span>(data_matrix[i]))</span><br><span class="line">    <span class="built_in">print</span>(<span class="string">&quot;data_matrix最大值为&quot;</span>, <span class="built_in">max</span>(new_data))</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">find_min</span>(<span class="params">data_matrix</span>):</span><br><span class="line">    new_data = []</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(data_matrix)):</span><br><span class="line">        new_data.append(<span class="built_in">min</span>(data_matrix[i]))</span><br><span class="line">    <span class="built_in">print</span>(<span class="built_in">min</span>(new_data))</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">variables_extact</span>(<span class="params">file</span>):</span><br><span class="line">    lon_list = []</span><br><span class="line">    lat_list = []</span><br><span class="line">    ssha_list = []</span><br><span class="line">    ssha_w_list = []</span><br><span class="line">    <span class="keyword">for</span> f <span class="keyword">in</span> file:</span><br><span class="line">        <span class="string">&#x27;&#x27;&#x27;第一重数据集--*.nc Dataset&#x27;&#x27;&#x27;</span></span><br><span class="line">        dataset_nc = nc.Dataset(f)</span><br><span class="line">        <span class="string">&#x27;&#x27;&#x27;第二重数据集--groups Dataset&#x27;&#x27;&#x27;</span></span><br><span class="line">        data_01 = dataset_nc.groups[<span class="string">&#x27;data_01&#x27;</span>]</span><br><span class="line">        lon = (data_01.variables[<span class="string">&#x27;longitude&#x27;</span>][:])</span><br><span class="line">        lat = (data_01.variables[<span class="string">&#x27;latitude&#x27;</span>][:])</span><br><span class="line">        <span class="string">&#x27;&#x27;&#x27;第三重数据集--ku Dataset&#x27;&#x27;&#x27;</span></span><br><span class="line">        ku = data_01.groups[<span class="string">&#x27;ku&#x27;</span>]</span><br><span class="line">        ssha = (ku.variables[<span class="string">&#x27;ssha&#x27;</span>][:])</span><br><span class="line">        data_lon = np.array(lon)</span><br><span class="line">        data_lat = np.array(lat)</span><br><span class="line">        data_ssha_all = np.array(ssha)</span><br><span class="line">        data_ssha = np.where(data_ssha_all != <span class="number">32767</span>, data_ssha_all * <span class="number">100</span>, <span class="number">0</span>)</span><br><span class="line">        <span class="comment"># min_lon = find_min([data_lon])</span></span><br><span class="line">        <span class="comment"># max_lon = find_max([data_lon])</span></span><br><span class="line">        <span class="comment"># min_lat = find_min([data_lat])</span></span><br><span class="line">        <span class="comment"># max_lat = find_max([data_lat])</span></span><br><span class="line">        <span class="comment"># min_ssha = find_min([data_ssha])</span></span><br><span class="line">        <span class="comment"># max_ssha = find_max([data_ssha])</span></span><br><span class="line">        <span class="comment"># print(min_lon, max_lon, min_lat, max_lat, min_ssha, max_ssha)</span></span><br><span class="line">        <span class="comment"># data_ssha[np.where(data_ssha != 0)] = 100 * (data_ssha[np.where(data_ssha != 0)] - min_ssha) / (</span></span><br><span class="line">        <span class="comment">#         max_ssha - min_ssha)</span></span><br><span class="line">        data_ssha_w = data_ssha * <span class="number">100</span></span><br><span class="line">        <span class="comment"># print(len(data_lon), len(data_lat), len(time), len(data_ssha))</span></span><br><span class="line">        <span class="comment"># print(data_lon, data_lat, data_time, data_ssha)</span></span><br><span class="line">        lon_list.extend(data_lon)</span><br><span class="line">        lat_list.extend(data_lat)</span><br><span class="line">        ssha_list.extend(data_ssha)</span><br><span class="line">        ssha_w_list.extend(data_ssha_w)</span><br><span class="line">    <span class="comment"># lon_all = lon_list.reshape((1, len(data_lon) * len(lon_list)), order=&#x27;A&#x27;)</span></span><br><span class="line">    <span class="comment"># print(lon_all)</span></span><br><span class="line">    lon_all = np.array(lon_list)</span><br><span class="line">    lat_all = np.array(lat_list)</span><br><span class="line">    ssha_all = np.array(ssha_list)</span><br><span class="line">    ssha_w_all = np.array(ssha_w_list)</span><br><span class="line">    <span class="built_in">print</span>(lon_all, lon_all.shape)</span><br><span class="line">    <span class="built_in">print</span>(lat_all, lat_all.shape)</span><br><span class="line">    <span class="built_in">print</span>(ssha_all, ssha_all.shape)</span><br><span class="line">    <span class="comment"># print(lon_list)</span></span><br><span class="line">    <span class="comment"># print(lat_list)</span></span><br><span class="line">    <span class="comment"># print(ssha_list)</span></span><br><span class="line">    <span class="comment"># print(ssha_w_list)</span></span><br><span class="line">    <span class="keyword">return</span> lon_all, lat_all, ssha_all, ssha_w_all</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">def</span> <span class="title function_">show_ssha_3d</span>(<span class="params">lon, lat, ssha, ssha_w</span>):</span><br><span class="line">    lon_lat_ssha = np.vstack((lon, lat, ssha_w)).T</span><br><span class="line">    <span class="built_in">print</span>(lon.shape, lat.shape, ssha_w.shape)</span><br><span class="line">    <span class="comment"># lon_arr = np.array(lon)</span></span><br><span class="line">    <span class="comment"># lon_lat_ssha.extend(lon)</span></span><br><span class="line">    <span class="built_in">print</span>(lon_lat_ssha[:, <span class="number">2</span>], lon_lat_ssha.shape)</span><br><span class="line">    ssha_mean_list = []</span><br><span class="line">    <span class="keyword">for</span> a <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">360</span>):</span><br><span class="line">        <span class="keyword">for</span> b <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">180</span>):</span><br><span class="line">            <span class="built_in">sum</span> = <span class="number">0</span></span><br><span class="line">            k_list = []</span><br><span class="line">            <span class="keyword">for</span> i, j, k <span class="keyword">in</span> lon_lat_ssha:</span><br><span class="line">                <span class="keyword">if</span> <span class="built_in">all</span>((<span class="built_in">abs</span>(i) &gt; a, <span class="built_in">abs</span>(i) &lt;= a + <span class="number">1</span>, <span class="built_in">abs</span>(j) &gt; b, <span class="built_in">abs</span>(j) &lt;= b + <span class="number">1</span>)):</span><br><span class="line">                    <span class="built_in">sum</span> += <span class="number">1</span></span><br><span class="line">                    k_list.extend([k])</span><br><span class="line">                    mean_ssha = math.fsum(k_list) / <span class="built_in">sum</span></span><br><span class="line">            <span class="built_in">print</span>(<span class="built_in">sum</span>, k_list, mean_ssha)</span><br><span class="line">            ssha_mean_list.extend([mean_ssha])</span><br><span class="line">    <span class="built_in">print</span>(ssha_mean_list)</span><br><span class="line">    <span class="comment"># lon_reshape = np.array(lon.reshape(len(lon), 1))</span></span><br><span class="line">    <span class="comment"># lat_reshape = np.array(lat.reshape(len(lat), 1))</span></span><br><span class="line">    <span class="comment"># ssha_reshape = np.array(ssha.reshape(len(ssha), 1))</span></span><br><span class="line">    <span class="comment"># print(lon_reshape, lat_reshape, ssha_reshape)</span></span><br><span class="line">    <span class="comment"># lon_lat = lon_reshape.extend(lat_reshape)</span></span><br><span class="line">    <span class="comment"># print(lon_lat)</span></span><br><span class="line"></span><br><span class="line">    <span class="built_in">map</span> = Basemap(projection=<span class="string">&#x27;cyl&#x27;</span>, llcrnrlat=-<span class="number">90.</span>, urcrnrlat=<span class="number">90.</span>, llcrnrlon=<span class="number">0.</span>, urcrnrlon=<span class="number">361.</span>, resolution=<span class="string">&#x27;l&#x27;</span>,</span><br><span class="line">                  lat_0=<span class="number">0</span>, lon_0=<span class="number">180</span>)</span><br><span class="line">    <span class="built_in">map</span>.drawmapboundary()</span><br><span class="line">    <span class="built_in">map</span>.fillcontinents(color=<span class="string">&#x27;gray&#x27;</span>, lake_color=<span class="string">&#x27;aqua&#x27;</span>)</span><br><span class="line">    <span class="built_in">map</span>.drawstates()</span><br><span class="line">    <span class="built_in">map</span>.drawcoastlines()</span><br><span class="line">    lons, lats = <span class="built_in">map</span>.makegrid(<span class="number">1</span>, <span class="number">6598</span>)</span><br><span class="line">    lats = lats[::-<span class="number">1</span>]</span><br><span class="line">    x, y = <span class="built_in">map</span>(lon, lat)</span><br><span class="line">    <span class="built_in">map</span>.drawparallels(np.arange(-<span class="number">90.</span>, <span class="number">91.</span>, <span class="number">30.</span>), labels=[<span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>], fontsize=<span class="number">12</span>)</span><br><span class="line">    <span class="built_in">map</span>.drawmeridians(np.arange(-<span class="number">180.</span>, <span class="number">181.</span>, <span class="number">60.</span>), labels=[<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>], fontsize=<span class="number">12</span>)</span><br><span class="line">    contour_map = <span class="built_in">map</span>.contour(x, y, ssha_mean_list, <span class="number">15</span>, linewidths=<span class="number">1.5</span>)</span><br><span class="line">    <span class="comment"># line_ssha = map.scatter(lon_lat_ssha[:, 0], lon_lat_ssha[:, 1], c=lon_lat_ssha[:, 2], s=1, vmin=-500, vmax=500)</span></span><br><span class="line">    plt.savefig(output_path + <span class="string">&#x27;interpolote.png&#x27;</span>)</span><br><span class="line">    plt.show(contour_map)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="string">&#x27;&#x27;&#x27;</span></span><br><span class="line"><span class="string">    fig = plt.figure()</span></span><br><span class="line"><span class="string">    # ax = Axes3D(fig)</span></span><br><span class="line"><span class="string">    ax2 = plt.axes(projection=&#x27;3d&#x27;)</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    X = lon</span></span><br><span class="line"><span class="string">    Y = lat</span></span><br><span class="line"><span class="string">    X, Y = np.meshgrid(X, Y)</span></span><br><span class="line"><span class="string">    print(len(X), len(Y), len(ssha))</span></span><br><span class="line"><span class="string">    Z = np.expand_dims(ssha, axis=1)</span></span><br><span class="line"><span class="string">    ax2.plot_surface(X, Y, Z, alpha=0.3, cmap=&#x27;rainbow&#x27;)</span></span><br><span class="line"><span class="string">    # ax2.contour(X, Y, Z, zdir=&#x27;z&#x27;, offset=-3, cmap=&quot;rainbow&quot;)</span></span><br><span class="line"><span class="string">    # ax2.contourf(X, Y, Z, zdir=&#x27;z&#x27;, offset=-3, cmap=&quot;rainbow&quot;)</span></span><br><span class="line"><span class="string">    plt.savefig(output_path + &#x27;_3d.png&#x27;)</span></span><br><span class="line"><span class="string">    plt.show()</span></span><br><span class="line"><span class="string">&#x27;&#x27;&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">&#x27;__main__&#x27;</span>:</span><br><span class="line">    postfix = <span class="string">&#x27;.nc&#x27;</span></span><br><span class="line">    <span class="comment"># prefix = &#x27;20211030&#x27;</span></span><br><span class="line">    <span class="comment"># prefix_list = [&#x27;20211020&#x27;, &#x27;20211021&#x27;, &#x27;20211022&#x27;, &#x27;20211023&#x27;, &#x27;20211024&#x27;, &#x27;20211025&#x27;, &#x27;20211026&#x27;, &#x27;20211027&#x27;,</span></span><br><span class="line">    <span class="comment">#                &#x27;20211028&#x27;, &#x27;20211029&#x27;, &#x27;20211030&#x27;]</span></span><br><span class="line">    <span class="comment"># print(prefix_list)</span></span><br><span class="line">    input_path = <span class="string">&#x27;/Users/leo/Desktop/MarineTechTest5/Data_Jason3/&#x27;</span></span><br><span class="line">    output_path = <span class="string">&#x27;/Users/leo/Desktop/MarineTechTest5/Results/&#x27;</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> <span class="keyword">not</span> os.path.exists(output_path):</span><br><span class="line">        os.mkdir(output_path)</span><br><span class="line">    file_list = os.listdir(input_path)</span><br><span class="line">    day_list = []</span><br><span class="line">    <span class="comment"># for k in prefix_list:</span></span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> file_list:</span><br><span class="line">        <span class="keyword">if</span> i.endswith(postfix):</span><br><span class="line">            file_nc = input_path + i</span><br><span class="line">            <span class="comment"># print(file_nc)</span></span><br><span class="line">            day_list.append(file_nc)</span><br><span class="line">    <span class="comment">#</span></span><br><span class="line">    <span class="built_in">print</span>(day_list)</span><br><span class="line">    <span class="comment">#     continue</span></span><br><span class="line">    lon, lat, ssha, ssha_w = variables_extact(day_list)</span><br><span class="line">    <span class="comment"># print(lon, lat, ssha)</span></span><br><span class="line">    show_ssha_3d(lon, lat, ssha, ssha_w)</span><br></pre></td></tr></table></figure>
<h1 id="结果与总结："><a href="#结果与总结：" class="headerlink" title="结果与总结："></a>结果与总结：</h1><h2 id="Jason-3-SSHA-2021-x2F-10-x2F-20—2021-x2F-10-x2F-30逐日数据全球分布图"><a href="#Jason-3-SSHA-2021-x2F-10-x2F-20—2021-x2F-10-x2F-30逐日数据全球分布图" class="headerlink" title="Jason-3 SSHA 2021&#x2F;10&#x2F;20—2021&#x2F;10&#x2F;30逐日数据全球分布图"></a>Jason-3 SSHA 2021&#x2F;10&#x2F;20—2021&#x2F;10&#x2F;30逐日数据全球分布图</h2><p><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211020.png" alt="2021/10/20"><br><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211021.png" alt="2021/10/21"><br><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211022.png" alt="2021/10/22"><br><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211023.png" alt="2021/10/23"><br><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211024.png" alt="2021/10/24"><br><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211025.png" alt="2021/10/25"><br><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211026.png" alt="2021/10/26"><br><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211027.png" alt="2021/10/27"><br><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211028.png" alt="2021/10/28"><br><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211029.png" alt="2021/10/29"><br><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211030.png" alt="2021/10/30"></p>
<h2 id="Jason-3-SSHA-2021-x2F-10-x2F-20—2021-x2F-10-x2F-30所有数据全球分布图"><a href="#Jason-3-SSHA-2021-x2F-10-x2F-20—2021-x2F-10-x2F-30所有数据全球分布图" class="headerlink" title="Jason-3 SSHA 2021&#x2F;10&#x2F;20—2021&#x2F;10&#x2F;30所有数据全球分布图"></a>Jason-3 SSHA 2021&#x2F;10&#x2F;20—2021&#x2F;10&#x2F;30所有数据全球分布图</h2><p><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211020_30.png" alt="2021/10/20-30"></p>
<h2 id="Jason-3-SSHA-2021-x2F-10-x2F-20—2021-x2F-10-x2F-30所有数据全球分布图-等值线插值结果"><a href="#Jason-3-SSHA-2021-x2F-10-x2F-20—2021-x2F-10-x2F-30所有数据全球分布图-等值线插值结果" class="headerlink" title="Jason-3 SSHA 2021&#x2F;10&#x2F;20—2021&#x2F;10&#x2F;30所有数据全球分布图(等值线插值结果)"></a>Jason-3 SSHA 2021&#x2F;10&#x2F;20—2021&#x2F;10&#x2F;30所有数据全球分布图(等值线插值结果)</h2><p><img src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/20211020_30lines.png" alt="2021/10/20-30等值线插值"><br>在读取Jason数据中，由于它是以点与经纬度储存的数据，所以可视化的时候应注意到，其处理方式需要将其转化为数组，在做相应的计算与拉伸，才能达到理想的效果。</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:guojiaxiang0820@gmail.com" rel="external nofollow noreferrer">洛沐</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://www.guojxblog.cn/archives/59a3b95f.html">https://www.guojxblog.cn/archives/59a3b95f.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="external nofollow noreferrer" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://www.guojxblog.cn" target="_blank">洛沐の人间客栈</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Python%E5%8D%AB%E6%98%9F%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86/">Python卫星数据处理</a></div><div class="post_share"><div class="social-share" data-image="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Jason-3SSHA/lulu.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/wechat.jpeg" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/wechat.jpeg" alt="微信"/></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/alipay.jpeg" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/alipay.jpeg" alt="支付宝"/></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/archives/92a27152.html"><img class="prev-cover" src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/GMI_RainRate/smile.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">GMI降雨率数据Hovmoller纬向显示——Python代码实现</div></div></a></div><div class="next-post pull-right"><a href="/archives/58b02e48.html"><img class="next-cover" src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/modis_radiometric_geometric_correction/birthday.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">MODIS L1B数据辐射定标几何校正云掩膜波段合成Python批处理代码实现</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/archives/92a27152.html" title="GMI降雨率数据Hovmoller纬向显示——Python代码实现"><img class="cover" src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/GMI_RainRate/smile.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-03-20</div><div class="title">GMI降雨率数据Hovmoller纬向显示——Python代码实现</div></div></a></div><div><a href="/archives/58b02e48.html" title="MODIS L1B数据辐射定标几何校正云掩膜波段合成Python批处理代码实现"><img class="cover" src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/modis_radiometric_geometric_correction/birthday.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-03-10</div><div class="title">MODIS L1B数据辐射定标几何校正云掩膜波段合成Python批处理代码实现</div></div></a></div><div><a href="/archives/b9d5eb5f.html" title="SMAP海洋表面盐度（SSS）数据可视化——Python实现"><img class="cover" src="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/loading3.gif" data-original="https://luomublog.oss-cn-qingdao.aliyuncs.com/ImgHost/Smap_SSS/loli.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-03-25</div><div class="title">SMAP海洋表面盐度（SSS）数据可视化——Python实现</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="lv-container" data-id="city" data-uid="MTAyMC81NjIzOS8zMjcwMg=="></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content is-expand"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Jason-3%E6%95%B0%E6%8D%AE%E4%BB%8B%E7%BB%8D"><span class="toc-number">1.</span> <span class="toc-text">Jason-3数据介绍</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Python%E4%BB%A3%E7%A0%81%E4%B8%8E%E6%B3%A8%E9%87%8A%E8%AF%A6%E8%A7%A3"><span class="toc-number">2.</span> <span class="toc-text">Python代码与注释详解</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%80%90%E6%97%A5%E6%95%B0%E6%8D%AE%E7%94%BB%E5%9C%A8%E5%9C%B0%E5%9B%BE%EF%BC%88%E6%AF%8F%E6%97%A5%E4%B8%80%E5%BC%A0%EF%BC%8C%E6%A0%87%E6%B3%A8%E7%BB%8F%E7%BA%AC%E5%BA%A6%E3%80%81%E6%95%B0%E5%80%BCcolorbar%E3%80%81%E6%97%A5%E6%9C%9Ftitle%E7%AD%89%EF%BC%89%EF%BC%8C%E4%BF%9D%E5%AD%98%E5%9B%BE%E7%89%87%E4%BB%A3%E7%A0%81"><span class="toc-number">2.1.</span> <span class="toc-text">逐日数据画在地图（每日一张，标注经纬度、数值colorbar、日期title等），保存图片代码</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Cycle210%EF%BC%8C2021-x2F-10-x2F-20-10-x2F-30%E6%95%B0%E6%8D%AE%E7%94%BB%E5%9C%A8%E4%B8%80%E5%BC%A0%E5%9C%B0%E5%9B%BE%E4%B8%8A%EF%BC%88%E4%B8%80%E5%85%B1%E4%B8%80%E5%BC%A0%EF%BC%8C%E6%A0%87%E6%B3%A8%E7%BB%8F%E7%BA%AC%E5%BA%A6%E3%80%81%E6%95%B0%E5%80%BCcolorbar%E3%80%81%E6%97%A5%E6%9C%9Ftitle%E7%AD%89%EF%BC%89-%EF%BC%89%EF%BC%8C%E4%BF%9D%E5%AD%98%E5%9B%BE%E7%89%87%E4%BB%A3%E7%A0%81"><span class="toc-number">2.2.</span> <span class="toc-text">Cycle210，2021&#x2F;10&#x2F;20-10&#x2F;30数据画在一张地图上（一共一张，标注经纬度、数值colorbar、日期title等） ），保存图片代码</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2021-x2F-10-x2F-20-10-x2F-30%E6%95%B0%E6%8D%AE%E7%94%BB%E7%AD%89%E5%80%BC%E7%BA%BF%E5%9B%BE%EF%BC%8C%E4%BF%9D%E5%AD%98%E5%9B%BE%E7%89%87%E4%BB%A3%E7%A0%81"><span class="toc-number">2.3.</span> <span class="toc-text">2021&#x2F;10&#x2F;20-10&#x2F;30数据画等值线图，保存图片代码</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%BB%93%E6%9E%9C%E4%B8%8E%E6%80%BB%E7%BB%93%EF%BC%9A"><span class="toc-number">3.</span> <span class="toc-text">结果与总结：</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#Jason-3-SSHA-2021-x2F-10-x2F-20%E2%80%942021-x2F-10-x2F-30%E9%80%90%E6%97%A5%E6%95%B0%E6%8D%AE%E5%85%A8%E7%90%83%E5%88%86%E5%B8%83%E5%9B%BE"><span class="toc-number">3.1.</span> <span class="toc-text">Jason-3 SSHA 2021&#x2F;10&#x2F;20—2021&#x2F;10&#x2F;30逐日数据全球分布图</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Jason-3-SSHA-2021-x2F-10-x2F-20%E2%80%942021-x2F-10-x2F-30%E6%89%80%E6%9C%89%E6%95%B0%E6%8D%AE%E5%85%A8%E7%90%83%E5%88%86%E5%B8%83%E5%9B%BE"><span class="toc-number">3.2.</span> <span class="toc-text">Jason-3 SSHA 2021&#x2F;10&#x2F;20—2021&#x2F;10&#x2F;30所有数据全球分布图</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Jason-3-SSHA-2021-x2F-10-x2F-20%E2%80%942021-x2F-10-x2F-30%E6%89%80%E6%9C%89%E6%95%B0%E6%8D%AE%E5%85%A8%E7%90%83%E5%88%86%E5%B8%83%E5%9B%BE-%E7%AD%89%E5%80%BC%E7%BA%BF%E6%8F%92%E5%80%BC%E7%BB%93%E6%9E%9C"><span class="toc-number">3.3.</span> <span class="toc-text">Jason-3 SSHA 2021&#x2F;10&#x2F;20—2021&#x2F;10&#x2F;30所有数据全球分布图(等值线插值结果)</span></a></li></ol></li></ol></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2021 - 2023  <i id="heartbeat" class="fa fas fa-heartbeat"></i> 洛沐</div><div class="footer_custom_text">谢谢你来看<a href="https://www.guojxblog.cn/" style='color:red;Font-size:36'>我</a>，你今天真好看😘</div></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/HCLonely/images@master/others/heartbeat.min.css"></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">簡</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>function loadLivere () {
  if (typeof LivereTower === 'object') {
    window.LivereTower.init()
  }
  else {
    (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
    })(document, 'script');
  }
}

if ('Livere' === 'Livere' || !true) {
  if (true) btf.loadComment(document.getElementById('lv-container'), loadLivere)
  else loadLivere()
}
else {
  function loadOtherComment () {
    loadLivere()
  }
}</script></div><script src="/js/mobile_side.js"></script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js" async="async" mobile="true"></script><div class="pjax-reload"><script async="async">var arr = document.getElementsByClassName('recent-post-item');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__zoomIn');
    arr[i].setAttribute('data-wow-duration', '1s');
    arr[i].setAttribute('data-wow-delay', '700ms');
    arr[i].setAttribute('data-wow-offset', '100');
    arr[i].setAttribute('data-wow-iteration', '1');
}</script><script async="async">var arr = document.getElementsByClassName('card-widget');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__zoomIn');
    arr[i].setAttribute('data-wow-duration', '');
    arr[i].setAttribute('data-wow-delay', '');
    arr[i].setAttribute('data-wow-offset', '');
    arr[i].setAttribute('data-wow-iteration', '');
}</script></div><script defer="defer" src="https://cdn.jsdelivr.net/gh/graingert/wow@1.3.0/dist/wow.min.js"></script><script defer="defer" src="/js/wow_init.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script>
            window.imageLazyLoadSetting = {
                isSPA: true,
                preloadRatio: 3,
                processImages: null,
            };
        </script><script>window.addEventListener("load",function(){var t=/\.(gif|jpg|jpeg|tiff|png)$/i,r=/^data:image\/[a-z]+;base64,/;Array.prototype.slice.call(document.querySelectorAll("img[data-original]")).forEach(function(a){var e=a.parentNode;"A"===e.tagName&&(e.href.match(t)||e.href.match(r))&&(e.href=a.dataset.original)})});</script><script>!function(n){n.imageLazyLoadSetting.processImages=o;var e=n.imageLazyLoadSetting.isSPA,i=n.imageLazyLoadSetting.preloadRatio||1,r=Array.prototype.slice.call(document.querySelectorAll("img[data-original]"));function o(){e&&(r=Array.prototype.slice.call(document.querySelectorAll("img[data-original]")));for(var t,a=0;a<r.length;a++)0<=(t=(t=r[a]).getBoundingClientRect()).bottom&&0<=t.left&&t.top<=(n.innerHeight*i||document.documentElement.clientHeight*i)&&function(){var t,e,n,i,o=r[a];t=o,e=function(){r=r.filter(function(t){return o!==t})},n=new Image,i=t.getAttribute("data-original"),n.onload=function(){t.src=i,e&&e()},t.src!==i&&(n.src=i)}()}o(),n.addEventListener("scroll",function(){var t,e;t=o,e=n,clearTimeout(t.tId),t.tId=setTimeout(function(){t.call(e)},500)})}(this);</script><script async>window.onload=function(){var a=document.createElement('script'),b=document.getElementsByTagName('script')[0];a.type='text/javascript',a.async=!0,a.src='/sw-register.js?v='+Date.now(),b.parentNode.insertBefore(a,b)};</script></body></html>